USE [DS2012]
GO

IF object_id('usp_DislocationLoaderTemp') is not null
	DROP PROCEDURE usp_DislocationLoaderTemp
GO

CREATE PROCEDURE usp_DislocationLoaderTemp 
	@CarNumber varchar(8),
	@RollCheck int,
	@Lightweight int,
    @KindOfCar int,
    @TypeOfConditionalCodeOfCar int,
	@StartDate DateTime,
    @FeatTracking int,
    @StateCode int,
    @ActualCargoWeight int,
    @ArrivalStation int,
    @CargoRateCode int,
    @CargoOperativeCode int,
    @RecipientCode int,
    @SpecialNotesOfCar varchar(3),
    @NumberOfCaseCG int,
    @NumberOfCaseCP int,
    @NumberOfCaseKG int,
    @NumberOfCaseKP int,
    @ListNote varchar(6),
	@CarParkType int,
	@FaultCode int,
    @DepartureStation int,

	@OperationCode int,
    @OperationDate DateTime,
    @StationOfOperation int,
    @DeliveryRoad int,
    @ReceptRoad int,
    @TrainIndex varchar(13),
	@TrainNumber varchar(4)

AS SET NOCOUNT ON
BEGIN
	INSERT INTO tmpDislocation 
		(CarNumber,RollCheck,Lightweight,KindOfCar,TypeOfConditionalCodeOfCar,
			StartDate,FeatTracking,StateCode,ActualCargoWeight,ArrivalStation,CargoRateCode,CargoOperativeCode,
			RecipientCode,SpecialNotesOfCar,NumberOfCaseCG,NumberOfCaseCP,NumberOfCaseKG,NumberOfCaseKP,
			ListNote,CarParkType,FaultCode,DepartureStation,OperationCode,OperationDate,StationOfOperation,
			DeliveryRoad,ReceptRoad,TrainIndex,TrainNumber)
		VALUES(@CarNumber,@RollCheck,@Lightweight,@KindOfCar,@TypeOfConditionalCodeOfCar,
			@StartDate,@FeatTracking,@StateCode,@ActualCargoWeight,@ArrivalStation,@CargoRateCode,@CargoOperativeCode,
			@RecipientCode,@SpecialNotesOfCar,@NumberOfCaseCG,@NumberOfCaseCP,@NumberOfCaseKG,@NumberOfCaseKP,
			@ListNote,@CarParkType,@FaultCode,@DepartureStation,@OperationCode,@OperationDate,@StationOfOperation,
			@DeliveryRoad,@ReceptRoad,@TrainIndex,@TrainNumber)
END